package com.csi.service.impl;

import com.csi.dao.PermissionDao;
import com.csi.dao.impl.PermissionDaoImpl;
import com.csi.domain.Permission;
import com.csi.service.PermissionService;

import java.sql.SQLException;
import java.util.List;

public class PermissionServiceImpl implements PermissionService {
    @Override
    public List<Permission> findAll() {
        PermissionDao permissionDao = new PermissionDaoImpl();

        List<Permission> permissions = null;
        try {
            permissions = permissionDao.findAll();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }

        return permissions;
    }
}
